package com.six.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import com.six.entity.producttype;
import com.ljw.util.DBManager;
import com.ljw.util.QueryDataResult;

public class ProducttypeDaoImpl {

	public ArrayList<producttype> getAllProType() {
		String sql = "select * from producttype";

		System.out.println("执行的sql语句是" + sql);
		QueryDataResult execQuery = DBManager.executeQuery(sql);
		ArrayList<producttype> list = new ArrayList<producttype>();
		if (execQuery != null) {
			ResultSet rs = execQuery.rs;
			try {
				while (rs.next()) {
					producttype e = new producttype(rs.getInt("zhuid"), rs.getString("typeName"));

					list.add(e);
				}
			} catch (SQLException e) {
				e.printStackTrace();

			} finally {

				execQuery.close();
			}
		}
		System.out.println(list);
		return list;
	}

	
}
